//
//  Util.h
//  QBIM
//
//  Created by liunian on 14-3-17.
//  Copyright (c) 2014年 liunian. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Util : NSObject

#pragma mark - JSON
//JSON转换成Dict
+ (NSDictionary *)convertJSONToDict:(NSString *)string;
//Dictionary or Array转换成JSON
+ (NSString *)convertObjectToJSON:(id)object;
#pragma mark - Dictionary
//获取Dictionary中的元素,主要防止服务器发送@""或者obje-c转化成NSNull
+ (id)getElementForKey:(id)key fromDict:(NSDictionary *)dict;
//按照数据类型获取Dictionary中的元素,主要防止服务器发送@""或者obje-c转化成NSNull
+ (id)getElementForKey:(id)key fromDict:(NSDictionary *)dict forClass:(Class)forClass;
//获取Dictionary中的元素,当是字符串时候处理过滤空白字符,否则返回取出的值 add by zt 2013.5.28
+ (id)getElementForKey:(id)key fromDict:(NSDictionary *)dict character:(NSCharacterSet*)character;

@end
